
import 'package:beautiful_demo/config.dart';
import 'package:drive/drive.dart';

class BaseHttp{

}

get header=>{
  "token":"12323"
};

final errorJson={
  "status":500,
  "msg":"连接服务器失败"
};

Future<Map<String,dynamic>> httpGet(String url,Map<String,String > para) async {
  final path=Config.host+url;
  try {
    final result = HttpUtils.get(
        path, para, ho: HttpOption(header: header, timeOut: 300000),
        proxy: Config.proxy);
    return result;
  }catch(e){
    return errorJson;
  }
}

Future<Map<String,dynamic>> httpPost(String url,Map<String,String > para) async {
  final path=Config.host+url;


  try {
    final result = await HttpUtils.post(
        path, para, ho: HttpOption(header: header, timeOut: 300000),
        proxy: Config.proxy);
    return result;
  }catch(e){
    return errorJson;
  }

}

